package com.zzyl.mapper;


import com.zzyl.dto.ResourceDto;
import com.zzyl.entity.Resource;
import com.zzyl.entity.RoleResource;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface ResourceMapper {


//    @Select("select * from sys_resource")
    List<Resource> selectList(ResourceDto resourceDto);

    int insert(Resource resource);

    @Select("select * from sys_resource where resource_no = #{resourceNo}")
    Resource selectParentByNo(String parentResourceNo);



    void insertBatch(List<RoleResource> roleResource);




    @Select("select * from sys_resource where parent_resource_no=#{resourceNo}")
    int hasChildByMenuId(List<String> resourceNo);



         @Delete("delete from sys_resource where resource_no in (#{resourceNo})")
    void deleteByresourceNo(List<String> resourceNo);

     @Select("select * from sys_resource where resource_no in (#{resourceNo})")
    Resource selectByResourceNo(List<String> resourceNo);
}


